package cn.edu.jju.stepcounter2.chart;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import cn.edu.jju.stepcounter2.R;
import cn.edu.jju.stepcounter2.chart.presenter.ChartPresenter;
import cn.edu.jju.stepcounter2.chart.presenter.ChartPresenterImpl;
import cn.edu.jju.stepcounter2.chart.view.ChartView;
import cn.edu.jju.stepcounter2.utils.AppManager;
import lecho.lib.hellocharts.view.ColumnChartView;
import lecho.lib.hellocharts.view.PreviewColumnChartView;

public class ChartActivity extends AppCompatActivity implements ChartView {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chart);
        //AppManager.getAppManager().addActivity(this);
        ChartPresenter chartPresenter = new ChartPresenterImpl(this);
        chartPresenter.showChart();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //AppManager.getAppManager().finishActivity();
    }

    @Override
    public ColumnChartView getChartView() {
        return (ColumnChartView) findViewById(R.id.chart);
    }

    @Override
    public PreviewColumnChartView getPreviewView() {
        return (PreviewColumnChartView) findViewById(R.id.chart_preview);
    }

    @Override
    public TextView getTextViewById(int id) {
        return (TextView) findViewById(id);
    }
     public void back(View view){
             finish();
         }
}
